import java.util.HashSet;
import java.util.Iterator;
import java.util.Scanner;
import java.util.Set;

public class HihoCoder1546 {

	static int mod = 1000000007;
	static int count = 0;
	static Set<Integer> hasSet = new HashSet<Integer>();
	static int K = 0;
	static int z = 0;

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		K = in.nextInt();
		int[] num = new int[N];
		for (int i = 0; i < N; i++) {
			int value = in.nextInt();
			if (value <= K) {
				num[z] = value;
				z++;
			}
		}

		DSF(num, 0);
		System.out.println(count % mod);
	}

	private static boolean DSF(int[] num, int index) {
		if (index >= z && iSCheckOunt() && hasSet.size() > 0) {
			count++;
			return true;
		}
		for (int i = 1; i <= 2; i++) {
			if (index <= z && num[index] < K) {
				if (i == 1) {
					if (num[index] != 0) {
						hasSet.add(num[index]);
					}
				}
				DSF(num, index + 1);
				hasSet.remove(num[index]);	
			}
		}
		return false;

	}

	private static boolean iSCheckOunt() {
		int max = 0;
		int min = 0;
		Iterator item = hasSet.iterator();
		int i = 0;
		while (item.hasNext()) {
			int a = (Integer) item.next();
			if (i == 0) {
				min = a;
				i++;
			}
			min = min < a ? min : a;
			max = max > a ? max : a;
		}
		if (min + max <= K && min > 0 && max > 0) {
			/*item = hasSet.iterator();
			while (item.hasNext()) {
				int a = (Integer) item.next();
				System.out.print(a + " ");
			}
			System.out.println();*/
			return true;
		}
		return false;
	}

}
